//
//  MovieDataViewController.m
//  FNer
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 刘志强. All rights reserved.
//

#import "MovieDataViewController.h"
#import "MoviePlayerViewController.h"
#import "DataHandle.h"
@interface MovieDataViewController ()

@end

@implementation MovieDataViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = self.model.title;
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.videoImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 260)];
    
    [self.videoImage sd_setImageWithURL:[NSURL URLWithString:self.model.coverForFeed] placeholderImage:[UIImage imageNamed:@""]];
    [self.view addSubview:self.videoImage];
    
    self.playButtion = [[UIButton alloc] initWithFrame:CGRectMake(170, 100, 40, 40)];
     [self.playButtion setImage:[UIImage imageNamed:@"iconfont-bofang.png"] forState:0];
    
    [self.view addSubview:self.playButtion];
    
   [self.playButtion addTarget:self action:@selector(playVideo:) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel *jianjie = [[UILabel alloc] initWithFrame:CGRectMake(10, 320, 100, 30)];
    jianjie.text = @"简介:";
    jianjie.font = [UIFont systemFontOfSize:30];
    [jianjie setTextColor:[UIColor blackColor]];
    [self.view addSubview:jianjie];
    

    
    //视频name
    self.name = [[UILabel alloc] initWithFrame:CGRectMake(10, 260, 330, 40)];
    self.name.font = [UIFont systemFontOfSize:18];
    self.name.numberOfLines = 0;
    self.name.text = self.model.title;
    self.name.textColor = [UIColor blackColor];
    
    [self.view addSubview:self.name];
    
    //视频简介
    self.descriPtion = [[UILabel alloc] initWithFrame:CGRectMake(10, 360, 355, 130)];
    
    self.descriPtion.numberOfLines  = 0;
    [self.descriPtion setTextColor:[UIColor blackColor]];
    
    self.descriPtion.font = [UIFont systemFontOfSize:18];
    
    self.descriPtion.text = self.model.descriPtion;
    
    [self.view addSubview:self.descriPtion];
    
    
}

-(void)playVideo:(UIButton *)buttion
{
    NSURL *url = [NSURL URLWithString:self.model.playUrl];
    
    MoviePlayerViewController *av = [[MoviePlayerViewController alloc] initNetMovieWithURL:url];
    
    
    
    [self presentViewController:av animated:YES completion:nil];
    
    
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
